﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Truextend.CoffeShop.Model;
using Truextend.CoffeShop.Service.Infrastructure;
using Truextend.CoffeShop.Bussiness.Interfaces;
using Truextend.CoffeShop.Bussiness;

namespace Truextend.CoffeShop.Service
{
    public class ProductService : BaseService
    {
        public IList<Product> GetAllInternalProducts()
        {
            IList<Product> result = null;

            ExecuteManager(uow => 
            {
                IProductManager manager = new ProductManager(uow);
                result = manager.GetAllInternalProducts();
            });

            return result;
        }

        public IList<Product> GetAllProductsForRestaurant(int restaurantId)
        {
            IList<Product> result = null;

            ExecuteManager(uow => 
                            {
                                IProductManager manager = new ProductManager(uow);
                                result = manager.GetAllProductsForRestaurant(restaurantId);
                            });

            return result;
        }
    }
}
